<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="toggle.css" rel="stylesheet">
    <script src="../../js/jquery-2.1.1.min.js"></script>
    <script>
        $('.toggle').click(function (e) {
            var toggle = this;
            e.preventDefault();
            $(toggle).toggleClass('toggle--on')
                    .toggleClass('toggle--off')
                    .addClass('toggle--moving');
            setTimeout(function () {
                $(toggle).removeClass('toggle--moving');
            }, 200)
        });
    </script>
</head>
<body>
<h1>Toggle.</h1>
<a href="#" class="toggle toggle--on"></a>
</body>
</html>